package com.chen.Dome2reflect;

import java.lang.reflect.Constructor;

public class ReflectDome1 {
    public static void main(String[] args) throws ClassNotFoundException {
        //目标：通过反射创建对象，并调用方法
        //1.获取Class对象通过类名.class获取
        Class c1 = Student.class;
        System.out.println(c1);
        //2.通过getClass()方法获取
        Student s = new Student();
        Class c2 = s.getClass();
        System.out.println(c2);
        //3.通过类加载器获取
        Class c3=Class.forName("com.chen.Dome2reflect.Student");
        System.out.println(c3);

    }
}
